<template>
    <div class="header">
        <div class="l-content">
            <el-button size="small" icon="menu" @click="handle"></el-button>
            <el-breadcrumb separator="/" class="bread">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="r-content">
            <el-dropdown>
                <span class="el-dropdown-link">
                    <img :src="getImageUrl" alt="头像" class="user">
                </span>
                <template #dropdown>
                    <el-dropdown-menu>
                        <el-dropdown-item>Action 1</el-dropdown-item>
                        <el-dropdown-item>Action 2</el-dropdown-item>
                    </el-dropdown-menu>
                </template>
            </el-dropdown>
        </div>
    </div>
</template>

<script setup>
// 修改为直接导入图片，这是Vite中引用静态资源的推荐方式
import userImage from '@/assets/images/user.png'
import {isCollapseData} from '@/stores/isCollapseData'
const getImageUrl = userImage
const store = isCollapseData()
function handle() {
    store.isCollapse = !store.isCollapse
}
</script>

<style lang="less" scoped>
.header{
    display: flex;
    justify-content:space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color:#333;
}
.icons{
    width: 20px;
    height: 20px;
}
.r-content{
    .user {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            vertical-align: middle;
        }
}
.l-content{
    display: flex;
    align-items: center;
    .el-button{
        margin-right:20px;
    }
}
// .bread span{
//     color: #fff;
//     cursor: pointer;
// }
:deep(.bread span){
    color: #fff !important;
    cursor: pointer !important;
}
</style>